Function Reference

GUICtrlCreateCombo

Creates a ComboBox control for the GUI.

GUICtrlCreateCombo ( "text", left, top [, width [, height [, style [, exStyle]]]] )

 

Parameters

text The text which will appear in the combo control.
left The left side of the control. If -1 is used then left will be computed according to GUICoordMode.
top The top of the control. If -1 is used then top will be computed according to GUICoordMode.
width [optional] The width of the control (default is the previously used width).
height [optional] The height of the control (default is the previously used height).
style [optional] Defines the style of the control. See GUI Control Styles Appendix.

default (-1) : $CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL
forced style : $WS_TABSTOP
exStyle [optional] Defines the extended style of the control. See Extended Style Table.

 

Return Value

Success: Returns the identifier (controlID) of the new control.
Failure: Returns 0.

 

Remarks

To obtain the value of the control see GUICtrlRead.
To set or change information in the control see GUICtrlSet....

Under Windows XP/2003 Windows will ajust the size of the opened combo. On other Windows versions you can define this size with the "height" parameter if the default value is not BIG enough to contain at least one line.

To combine styles with the default style use BitOr($GUI_SS_DEFAULT_COMBO, newstyle,...).

Default resizing is $GUI_DOCKHEIGHT.

 

Related

GUICoordMode (Option), GUICtrlSetData, GUICtrlSet..., GUIGetMsg

 

Example


#include <GUIConstants.au3>

GUICreate("My GUI combo")  ; will create a dialog box that when displayed is centered

GUICtrlCreateCombo ("item1", 10,10) ; create first item
GUICtrlSetData(-1,"item2|item3","item3") ; add other item snd set a new default

GUISetState ()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
   
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend